import java.util.ArrayList;
import java.util.Collection;

public class demo {
    public static void main(String[] args) {
        Collection<Integer> collection = new ArrayList<>();
        collection.add(1);
        collection.add(2);
        collection.add(3);
        collection.add(4);

        System.out.println(collection.isEmpty());
        collection.clear(); // 调用clear方法, 清空当前集合
        System.out.println(collection.isEmpty());
    }
}
